package com.sunfeng.demo01;

/**
 * @description:
 * @author: 孙 峰
 * @time: 2020/11/3 12:25
 */
public class Demo01 {
    public static void main(String[] args) {
        int gcd = gcd(10, 4);
        System.out.println(gcd);
    }

    public static int gcd(int p, int q) {
        if (q == 0) {
            return p;
        }
        int r = p % q;
        return gcd(q, r);
    }
}
